package area;

public class Triangle {
    private double firstEdge;
    private double secondEdge;
    private double thirdEdge;
    public void squaring() {
        if (firstEdge + secondEdge <= thirdEdge || secondEdge + thirdEdge <= firstEdge ||
                firstEdge + thirdEdge <= secondEdge) {
            System.out.println("边长不合法");
        } else {
            double s =(firstEdge+secondEdge+thirdEdge)/2f;
            double squaring = Math.sqrt(s*(s-firstEdge)*(s-secondEdge)*(s-thirdEdge));
            System.out.println(squaring);
        }
    }
    public static void main(String[] args) {
        Triangle t = new Triangle();
        t.firstEdge = 30;
        t.secondEdge = 40;
        t.thirdEdge = 50;
        t.squaring();
    }
}